//对外暴露配置路由(常量路由)
export const constantRoute = [
    {
        //登录
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login',
        meta: {
            title: '登录',//菜单标题(meta 用于存储路由的元信息，如标题、权限等)
            hidden: true,//代表路由标题在菜单中是否隐藏  true:隐藏 false:不隐藏
            icon: "Promotion",//菜单文字左侧的图标,支持element-plus全部图标
        }
    },
    {
        path: '/',
        component: () => import('@/layout/index.vue'),
        name: 'layout',
        redirect: '/home',
        meta: {
            title: '首页',
            icon: 'HomeFilled'
        },
        children: [
            {
                path: '/home',
                component: () => import('@/views/home/index.vue'),
                name: 'Home',
                meta: {
                    title: '校园公告',
                    icon: 'DataAnalysis'
                }
            }
        ]
    },
    {
        path: '/activity',
        component: () => import('@/layout/index.vue'),
        name: 'Activity',
        meta: {
            title: '活动管理',
            icon: 'User'
        },
        children: [
            {
                path: '/publishActivity',
                component: () => import('@/views/activity/publish/index.vue'),
                name: 'Publish',
                meta: {
                    title: '活动发布',
                    icon: 'User'
                }
            },
            {
                path: '/enroll',
                component: () => import('@/views/activity/enroll/index.vue'),
                name: 'Enroll',
                meta: {
                    title: '活动报名',
                    icon: 'Document'
                }
            }
        ]
    },
    {
        path: '/lost',
        component: () => import('@/layout/index.vue'),
        name: 'Lost',
        meta: {
            title: '失物招领管理',
            icon: 'Setting'
        },
        children: [
            {
                path: '/publishLost',
                component: () => import('@/views/lost/publish/index.vue'),
                name: 'PublishLost',
                meta: {
                    title: '失物发布',
                    icon: 'DataAnalysis'
                }
            },
            {
                path: '/receive',
                component: () => import('@/views/lost/receive/index.vue'),
                name: 'Receive',
                meta: {
                    title: '失物接收',
                    icon: 'User'
                }
            },
        ]
    },
    {
        path: '/me',
        component: () => import('@/layout/index.vue'),
        name: 'Me',
        redirect: '/meCenter',
        meta: {
            title: '个人中心',
            icon: 'HomeFilled'
        },
        children: [
            {
                path: '/meCenter',
                component: () => import('@/views/me/index.vue'),
                name: 'MeCenter',
                meta: {
                    title: '个人中心',
                    icon: 'DataAnalysis'
                }
            }
        ]
    },
    {
        // 404页面
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true
        }
    },

]


export const anyRoute = [
    {
        // 任意路由重定向到404
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        name: 'Any',
        meta: {
            title: '任意路由',
            hidden: true
        }
    }
]

export const asyncRoute = [
    {
        path: '/permission',
        component: () => import('@/layout/index.vue'),
        name: 'Permission',
        redirect: '/permission/page',
        meta: {
            title: '用户管理',
            icon: 'Setting'
        },
        children: [
            {
                path: '/permission/page',
                component: () => import('@/views/user/index.vue'),
                name: 'PagePermission',
                meta: {
                    title: '用户管理',
                    icon: 'DataAnalysis'
                }
            }
        ]
    }
]
